import {httpClient} from "@/main/apis/axios_proxy.js";

export function invoke_url({
                               url,
                               method,
                               body,
                               responseType
                           }) {

    if (method === "GET") {
        return httpClient.get(
            url,
            {
                responseType: responseType
            }
        )
    } else if (method === "POST") {
        return httpClient.post(
            url,
            body,
            {
                responseType: responseType
            }
        )
    }

    throw new Error(`不支持的方法:${method}`);
}